<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Add a field to be used to group results</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="solrquery.addfilterquery.html">« SolrQuery::addFilterQuery</a></li>
      <li style="float: right;"><a href="solrquery.addgroupfunction.html">SolrQuery::addGroupFunction »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.solrquery.html">SolrQuery</a></li>
    <li>Add a field to be used to group results</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="solrquery.addgroupfield" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SolrQuery::addGroupField</h1>
  <p class="verinfo">(PECL solr &gt;= 2.2.0)</p><p class="refpurpose"><span class="refname">SolrQuery::addGroupField</span> &mdash; <span class="dc-title">Add a field to be used to group results</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-solrquery.addgroupfield-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>SolrQuery::addGroupField</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code></span>): <span class="type"><a href="class.solrquery.html" class="type SolrQuery">SolrQuery</a></span></div>

  <p class="para rdfs-comment">
    The name of the field by which to group results. The field must be single-valued, and either be indexed
    or a field type that has a value source and works in a function query,
    such as ExternalFileField. It must also be a string-based field, such as StrField or TextField
    Uses group.field parameter
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-solrquery.addgroupfield-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">value</code></dt>

    <dd>

     <p class="para">
      The name of the field.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-solrquery.addgroupfield-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an instance of <span class="classname"><a href="class.solrquery.html" class="classname">SolrQuery</a></span>.
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-solrquery.addgroupfield-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="methodname"><a href="solrquery.setgroup.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::setGroup()</a> - Enable/Disable result grouping (group parameter)</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.addgroupfunction.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::addGroupFunction()</a> - Allows grouping results based on the unique values of a function query (group.func parameter)</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.addgroupquery.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::addGroupQuery()</a> - Allows grouping of documents that match the given query</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.addgroupsortfield.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::addGroupSortField()</a> - Add a group sort field (group.sort parameter)</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.setgroupfacet.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::setGroupFacet()</a> - Sets group.facet parameter</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.setgroupoffset.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::setGroupOffset()</a> - Sets the group.offset parameter</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.setgrouplimit.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::setGroupLimit()</a> - Specifies the number of results to return for each group. The server default value is 1</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.setgroupmain.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::setGroupMain()</a> - If true, the result of the first field grouping command is used as the main result list in the response, using group.format=simple</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.setgroupngroups.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::setGroupNGroups()</a> - If true, Solr includes the number of groups that have matched the query in the results</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.setgrouptruncate.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::setGroupTruncate()</a> - If true, facet counts are based on the most relevant document of each group matching the query</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.setgroupformat.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::setGroupFormat()</a> - Sets the group format, result structure (group.format parameter)</span></li>
   <li class="member"><span class="methodname"><a href="solrquery.setgroupcachepercent.html" class="methodname" rel="rdfs-seeAlso">SolrQuery::setGroupCachePercent()</a> - Enables caching for result grouping</span></li>
  </ul>
 </div>

</div></div></div></body></html>